<template>
  <div class="test" @click="change">
    {{Boolean}}
  </div>
</template>

<script>
  export default {
    name: "test",
    props: {
      state: Boolean
    },
    model: {
      prop: 'state',
      event: 'state'
    },
    data() {
      return {}
    },
    watch: {
      state: function (val, old) {
        console.log('state', val, old);
      }
    },
    methods: {
      change() {
        this.$emit('state', !this.state)
      }
    }
  }
</script>

<style lang="scss" scoped>
  .test {
    padding: 10px;
    margin: 10px;
    border: 1px solid #44bb00;
    background: $BackgroundTheme;
  }
</style>
